import Cookies from 'js-cookie'

const Psw = 'Psw'
const TokenKey = 'Admin-Token'
const HospitalId = 'HospitalId'
const HospitalName = 'HospitalName'
const UserId = 'UserId'
const MeetPrefix = 'meetPrefix'
const Name = 'Name'
const Deptment = 'Deptment'
const ApiToken = 'ApiToken'
const SysRole = 'SysRole'
const Roles = 'Roles'
const ConsultationsId = 'ConsultationsId'
const Webcfg = 'Webcfg'

/*
** psw 存取删
*/
export function setPsw(psw) {
  return Cookies.set(Psw, psw)
}
export function getPsw() {
  return Cookies.get(Psw)
}
export function removePsw() {
  return Cookies.remove(Psw)
}

/*
** 身份token 存取删
*/
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
export function getToken() {
  return Cookies.get(TokenKey)
}
export function removeToken() {
  return Cookies.remove(TokenKey)
}

/*
** HospitalId 存取删
*/
export function setHospitalId(hospitalId) {
  return Cookies.set(HospitalId, hospitalId)
}
export function getHospitalId() {
  return Cookies.get(HospitalId)
}
export function removeHospitalId() {
  return Cookies.remove(HospitalId)
}

/*
** HospitalName 存取删
*/
export function setHospitalName(hospitalName) {
  return Cookies.set(HospitalName, hospitalName)
}
export function getHospitalName() {
  return Cookies.get(HospitalName)
}
export function removeHospitalName() {
  return Cookies.remove(HospitalName)
}

/*
** 姓名 存取删
*/
export function setName(name) {
  return Cookies.set(Name, name)
}
export function getName() {
  return Cookies.get(Name)
}
export function removeName() {
  return Cookies.remove(Name)
}

/*
** 科室 存取删
*/
export function setDeptment(deptment) {
  return Cookies.set(Deptment, deptment)
}
export function getDeptment() {
  return Cookies.get(Deptment)
}
export function removeDeptment() {
  return Cookies.remove(Deptment)
}

/*
** userId 存取删
*/
export function setUserId(userId) {
  return Cookies.set(UserId, userId)
}
export function getUserId() {
  return Cookies.get(UserId)
}
export function removeUserId() {
  return Cookies.remove(UserId)
}

/*
** meetPrefix 存取删
*/
export function setMeetPrefix(meetPrefix) {
  return Cookies.set(MeetPrefix, meetPrefix)
}
export function getMeetPrefix() {
  return Cookies.get(MeetPrefix)
}
export function removeMeetPrefix() {
  return Cookies.remove(MeetPrefix)
}
/*
** apitoken 存取删
*/
export function setApiToken(apitoken) {
  return Cookies.set(ApiToken, apitoken)
}
export function getApiToken() {
  return Cookies.get(ApiToken)
}
export function removeApiToken() {
  return Cookies.remove(ApiToken)
}

/*
** 是否显示创伤webcfg
*/
export function setWebcfg(webcfg) {
  return Cookies.set(Webcfg, webcfg)
}
export function getWebcfg() {
  return Cookies.get(Webcfg)
}
export function removeWebcfg() {
  return Cookies.remove(Webcfg)
}

/*
** sysRole-云智医登录用户角色 存取删(若有多个角色取首位)
*/
export function setSysRole(sysRole) {
  return Cookies.set(SysRole, sysRole)
}
export function getSysRole() {
  return Cookies.get(SysRole)
}
export function removeSysRole() {
  return Cookies.remove(SysRole)
}

/*
** roles-云智医登录用户角色code码(数组)    存取删
*/
export function setRoles(rolesArr) {
  return Cookies.set(Roles, rolesArr)
}
export function getRoles() {
  return Cookies.get(Roles)
}
export function removeRoles() {
  return Cookies.remove(Roles)
}

/*
** ConsultationsId- 会诊标识 存取删
*/
export function setConsultationsId(consultationsId) {
  return Cookies.set(ConsultationsId, consultationsId)
}
export function getConsultationsId() {
  return Cookies.get(ConsultationsId)
}
export function removeConsultationsId() {
  return Cookies.remove(ConsultationsId)
}
